<template>
	<view>
		<view class="container">
			<template>
				<u-steps :current="current" direction="column" inactiveColor="#969799" activeColor="#00BCB2" dot>
					<u-steps-item title="待支付" />
					<u-steps-item title="待评估" />
					<u-steps-item title="待派发" />
					<u-steps-item title="待出发" />
					<u-steps-item title="待服务" />
					<u-steps-item title="结束确认" />
				</u-steps>
			</template>
		</view>
	</view>
</template>

<script>
	import * as orderInfo from '../../common/api/orderInfo.js'
	export default {
		data() {
			return {
				current: 0,
				orderUid: '',
			}
		},
		onLoad(opt) {
			this.orderUid = opt.orderUid
			this.getOrderInfo()
		},
		methods: {
			getOrderInfo() {
				const param = {
					uid: this.orderUid
				}
				orderInfo.queryById(param).then(result => {
					let status = result.data.data.status
					if ("待支付" == status) {
						this.current = 0;
						console.log(11111)
					} else if ("待评估" == status) {
						this.current = 1;
						console.log(2222)
					} else if ("待派发" == status) {
						this.current = 2;
						console.log(3333)
					} else if ("待出发" == status) {
						this.current = 3;
						console.log(4444)
					} else if ("待服务" == status) {
						this.current = 4;
						console.log(5555)
					} else if ("结束确认" == status) {
						this.current = 5;
						console.log(6666)
					}
				}).catch(error => {
					console.log(error);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		background: white;
		box-sizing: border-box;
		padding: 24rpx;
	}
</style>